package com.xebia.pomodoro.messages
{
	import com.xebia.pomodoro.enums.P2PMessageType;

	public class RegisterationMessage extends P2PMessage
	{
		public var senderPeerId:String;

		public function RegisterationMessage(username:String, senderId:String)
		{
			super(P2PMessageType.REGISTERATION, username);
			this.senderPeerId = senderId;
		}

		override public function toString():String
		{
			var messageText:String = "";
			if (type == P2PMessageType.REGISTERATION)
			{
				messageText = "You are connected to " + username;
			}
			else if (type == P2PMessageType.UNREGISTERATION)
			{
				messageText = username + " has left";
			}
			return messageText;
		}
	}
}
